package com.huang.web.task;

import com.huang.domain.Children;
import com.huang.domain.ChinaTotal;
import com.huang.service.ChildrenService;
import com.huang.service.ChinaTotalService;
import com.huang.utils.ChildrenUtil;
import com.huang.utils.ChinaTotalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


import java.util.List;

@Component
public class MyTask {
    @Autowired
    private ChinaTotalService chinaTotalService;
    @Autowired
    private ChildrenService childrenService;

    public void excete() {

        ChinaTotal chinaTotal = ChinaTotalUtil.getChinaTotal();
        List<Children> childrenList = ChildrenUtil.getChildren();

        chinaTotalService.update(chinaTotal);
        childrenService.update(childrenList);

    }
}